Poor road conditions caused by potholes lead to increased accident risk, vehicle damage, and higher maintenance costs, yet many urban regions still rely on manual inspections or public complaints for detection. This paper presents a low cost, real time pothole detection and mapping system implemented using the YOLOv8n object detection model and deployed on a Raspberry Pi 4 platform. The system processes live road video from a Pi Camera, detects potholes using deep learning, and attaches GPS coordinates obtained from a Neo6M module. Detected frames are stored locally on an SD card while metadata such as timestamp, image name, pothole count, and geolocation are logged in a CSV file for later analysis. A Flask based web dashboard visualizes the pothole locations on an interactive Leaflet.js map and groups nearby detections within a 150 meter radius into clusters to indicate low, medium, or high severity road segments. The model was trained on a dataset of approximately 5000–6000 annotated images, augmented with rotation, flipping, brightness adjustment, and scaling, and evaluated using precision (0.832), recall (0.631), F1 score (0.718), mAP@0.5 (0.723), and mAP@0.5:0.95 (0.366). During deployment, the system achieved about 15 FPS for camera capture and 3.3 FPS for detection after ONNX optimization. The framework demonstrates that embedded AI can support practical, scalable road condition monitoring suitable for municipal and smart city applications.
Introduction
The proposed system is a real-time pothole detection and mapping solution that uses YOLOv8n deep learning, a Raspberry Pi 4, a Pi Camera, and a Neo6M GPS module to automatically detect potholes, record their locations, and visualize them on a web dashboard. The system aims to address the limitations of manual road inspections and citizen complaint-based reporting, which often result in delayed repairs, vehicle damage, traffic disruptions, and safety hazards.
Problem Statement
Road authorities need a low-cost, automated solution that can continuously monitor roads, detect potholes in real time, accurately geotag their locations, store data locally, and present the information through an easy-to-use map interface for maintenance planning and prioritization.
Literature Review
Traditional pothole detection methods relied on manual inspections or sensors such as accelerometers and ultrasonic sensors, which often suffered from low accuracy and environmental interference. Computer vision techniques improved automation but struggled with lighting and road texture variations. Recent research focuses on deep learning models like CNNs and YOLO, which provide higher detection accuracy and real-time performance. Integration with edge devices and GIS-based mapping has further enhanced road monitoring capabilities.
Proposed Methodology
The system operates as an edge AI solution on a Raspberry Pi 4:
Image Capture: An 8 MP Pi Camera continuously records road footage.
Pothole Detection: The YOLOv8n model processes video frames locally using ONNX Runtime and identifies potholes.
GPS Tagging: A Neo6M GPS module provides location data every 200 ms, ensuring accurate geotagging.
Data Storage: Detected pothole images are saved as JPEG files, while metadata such as timestamps, coordinates, pothole count, and cluster information are stored in CSV format.
Clustering and Severity Analysis: Potholes within a 150-meter radius are grouped into clusters and assigned severity levels:
Green: 1–4 potholes (Low)
Yellow: 5–9 potholes (Moderate)
Red: 10+ potholes (High)
Visualization: A Flask and Leaflet.js dashboard displays pothole locations and severity levels on an interactive map.
System Architecture
The architecture consists of five layers:
Hardware Layer: Pi Camera and Neo6M GPS connected to Raspberry Pi 4.
AI Processing Layer: YOLOv8n and ONNX Runtime perform pothole detection and severity analysis.
Data Management Layer: Stores images and metadata locally.
Web Server Layer: Flask server manages data access and dashboard communication.
Visualization Layer: Leaflet.js dashboard provides map-based monitoring for road authorities.
Implementation
The system is developed on a Raspberry Pi 4 Model B (4 GB RAM) using:
Python
YOLOv8n
ONNX Runtime
Flask
Leaflet.js
The dataset combines manually collected road footage and public datasets, resulting in 5,000–6,000 images. Data augmentation techniques such as flipping, rotation, brightness adjustment, blur, and noise addition improve model robustness. The YOLOv8n model is trained for 75 epochs on a Google Colab T4 GPU using images resized to 512 × 512 pixels.
Conclusion
The proposed system demonstrates that real-time pothole detection and mapping can be achieved effectively using low-cost edge hardware. By combining a Pi Camera, Raspberry Pi 4, YOLOv8n inference through ONNX Runtime, GPS-based tagging, local storage, and a Flask–Leaflet dashboard, the system provides a complete workflow for automated road-condition monitoring.
The results show that the approach is practical for field deployment, especially where internet connectivity is limited and rapid inspection is needed. The use of GPS clustering and severity-based visualization makes the output more useful for municipal planning by converting individual detections into actionable road-maintenance information.
At the same time, the system highlights the trade-off between accuracy and resource constraints on edge devices. Challenges such as limited inference speed, GPS dependency, and reduced performance in difficult lighting conditions indicate areas where further improvement is possible. Overall, the project offers a scalable and cost-effective foundation for smart transportation and road maintenance applications.
References
[1] Y. Safyari, M. Mahdianpari, and H. Shiri, “A Review of Vision-Based Pothole Detection Methods Using Computer Vision and Machine Learning,” Sensors, vol. 24, no. 5652, pp. 1–39, Aug. 2024, doi: 10.3390/s24175652.
[2] D. Arya, H. Maeda, S. K. Ghosh, D. Toshniwal, A. Mraz, T. Kashiyama, and Y. Sekimoto, “Deep Learning-Based Road Damage Detection and Classification for Multiple Countries,” Automation in Construction, vol. 132, p. 103935, Sep. 2021, doi: 10.1016/j.autcon.2021.103935.
[3] Z. Wang, Z. Ma, Z. Wang, S. Gao, and J. Peng, “A Novel Road Damage Detection Model with Efficient Attention and Dynamic Snake Convolution,” Engineering Applications of Artificial Intelligence, vol. 163, p. 112618, 2026, doi: 10.1016/j.engappai.2025.112618.
[4] P. Chede, S. Chitale, A. Mansuke, P. Ghodake, and S. P. Vidhate, “Real-Time Pothole Detection Using AI and ML,” International Research Journal of Engineering and Technology (IRJET), vol. 11, no. 10, pp. 812–816, Oct. 2024.
[5] B. R. Kumar, K. Hrushikesh, K. N. Reddy, and A. Sriram, “A Paper on Pothole Detection,” Journal of Engineering Sciences, vol. 14, no. 3, pp. 287–292, 2023.
[6] K. Singh, S. Hazra, C. Mukherjee, S. G., and S. Gowda, “IoT-Based Real-Time Pothole Detection System Using Image Processing Techniques,” International Journal of Scientific and Technology Research, vol. 9, no. 2, pp. 785–789, Feb. 2020.
[7] P. Chede, S. Chitale, A. Mansuke, P. Ghodake, and S. P. Vidhate, “Real-Time Pothole Detection Using ML,” International Research Journal of Modernization in Engineering, Technology and Science (IRJMETS), vol. 7, no. 4, pp. 7913–7919, Apr. 2025, doi: 10.56726/IRJMETS72686.
[8] M. Prakash B and S. K. C, “Enhanced Pothole Detection System Using YOLOX Algorithm,” Autonomous Intelligent Systems, vol. 2, no. 22, pp. 1–17, 2022, doi: 10.1007/s43684-022-00037-z.
[9] G. R. S. K. V. Rao, P. R. K. A. Tiwari, and N. B. B. Sahu, “Pothole Detection in Road Images Using Machine Learning,” International Journal of Engineering Research and Technology (IJERT), vol. 8, no. 4, pp. 1–6, 2020.
[10] D. V. D. H. S. Kumari, “Machine Learning Approach for Pothole Detection and Classification,” International Journal of Computer Applications, vol. 182, no. 37, pp. 1–4, 2019, doi: 10.5120/ijca2019918443.
[11] M. H. Asad, S. Khaliq, M. H. Yousaf, M. O. Ullah, and A. Ahmad, “Pothole Detection Using Deep Learning: A Real-Time and AI-on-the-Edge Perspective,” Advances in Civil Engineering, vol. 2022, Article ID 9221211, 13 pages, 2022, doi: 10.1155/2022/9221211.
[12] K. A. Vinodhini and K. R. A. Sidhaarth, “Pothole Detection in Bituminous Road Using CNN with Transfer Learning,” Measurement: Sensors, vol. 31, art. 100940, Feb. 2024, doi: 10.1016/j.measen.2023.100940.
[13] S. K. Satti, S. K. Devi, P. Maddula, and N. V. Ravipati, “Unified Approach for Detecting Traffic Signs and Potholes on Indian Roads,” Journal of King Saud University – Computer and Information Sciences, 2023 (in press).
[14] B. Kang and S. Choi, “Pothole Detection System Using 2D LiDAR and Camera,” in Proc. Int. Conf. on Ubiquitous and Future Networks (ICUFN), pp. 744–746, 2017.
[15] S. M. R. Ghosh, “Deep Learning for Computer Vision: A Brief Review,” IEEE Access, vol. 7, pp. 171903–171912, 2019, doi: 10.1109/ACCESS.2019.2957284.
[16] M. Alzahrani and M. T. Alghamdi, “A Survey on Pothole Detection and Classification Techniques,” Sensors, vol. 21, no. 1, p. 123, 2021, doi: 10.3390/s210100123.
[17] M. A. I. P. Mehta and K. S. Kumar, “Smart Pothole Detection System Using IoT and Machine Learning,” in Proc. 3rd Int. Conf. on Intelligent Computing and Control Systems (ICICCS), pp. 682–687, 2020, doi: 10.1109/ICICCS48848.2020.9142490.